package MathLib.triangulation.SaveStructures;



public class Node implements Cloneable {

    @Override
    @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
    public boolean equals(Object obj) {// дуже обережно з цим методом так як він перевіряє номер а не дійсно точку ...
        try{
            Node tmp = (Node) obj;
            //return ( (Math.abs(tmp.x-x)<0.000000001) && (Math.abs(tmp.y-y)<0.0000001) );
            return (tmp.Number==this.Number);
        }catch (Exception e){
            return false;
        }
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (int) (Double.doubleToLongBits(this.x) ^ (Double.doubleToLongBits(this.x) >>> 32));
        hash = 97 * hash + (int) (Double.doubleToLongBits(this.y) ^ (Double.doubleToLongBits(this.y) >>> 32));
        hash = 97 * hash + (this.IsOnBoundery ? 1 : 0);
        return hash;
    }

    @Override
    protected Object clone() {
        return new Node(x, y, IsOnBoundery, Number);
    }
    public Node MyClone(){
        return new Node(x, y, IsOnBoundery, Number);
    }


    public Node() {
    }

    public Node(double x, double y, boolean IsOnBoundery,int Number) {
        this.x = x;
        this.y = y;
        this.Number = Number;
        this.IsOnBoundery = IsOnBoundery;
    }
    
	public double x;
	public double y;
    public int Number;
    public boolean IsOnBoundery;	
}
